<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>水文数据上传</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4;
        }
        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
        }
        h1 {
            color: #333;
        }
        .form-group {
            margin-bottom: 20px;
        }
        label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }
        input[type="text"],
        input[type="number"],
        input[type="date"],
        select {
            width: 100%;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }
        .btn {
            padding: 10px 15px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }
        .btn:hover {
            background-color: #0056b3;
        }
        .required::after {
            content: " *";
            color: red;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>水文数据上传</h1>
        <form method="post" action="{{ url_for('upload_data') }}">
            <!-- 必填项 -->
            <div class="form-group">
                <label for="province" class="required">监测省份:</label>
                <input type="text" id="province" name="province" required>
            </div>

            <div class="form-group">
                <label for="location" class="required">监测地点:</label>
                <input type="text" id="location" name="location" required>
            </div>

            <div class="form-group">
                <label for="monitor_time">监测时间:</label>
                <input type="datetime-local" id="monitor_time" name="monitor_time">
            </div>

            <!-- 可选项 -->
            <div class="form-group">
                <label for="water_temp">水温 (°C):</label>
                <input type="number" id="water_temp" name="water_temp" step="0.1">
            </div>

            <div class="form-group">
                <label for="ph">pH:</label>
                <input type="number" id="ph" name="ph" step="0.1" min="0" max="14">
            </div>

            <div class="form-group">
                <label for="dissolved_oxygen">溶解氧量 (mg/L):</label>
                <input type="number" id="dissolved_oxygen" name="dissolved_oxygen" step="0.1">
            </div>

            <div class="form-group">
                <label for="conductivity">电导率 (μS/cm):</label>
                <input type="number" id="conductivity" name="conductivity" step="0.1">
            </div>

            <div class="form-group">
                <label for="turbidity">浊度 (NTU):</label>
                <input type="number" id="turbidity" name="turbidity" step="0.1">
            </div>

            <div class="form-group">
                <label for="permanganate_index">高锰酸盐指数 (mg/L):</label>
                <input type="number" id="permanganate_index" name="permanganate_index" step="0.1">
            </div>

            <div class="form-group">
                <label for="ammonia_nitrogen">氨氮 (mg/L):</label>
                <input type="number" id="ammonia_nitrogen" name="ammonia_nitrogen" step="0.1">
            </div>

            <div class="form-group">
                <label for="total_phosphorus">总磷 (mg/L):</label>
                <input type="number" id="total_phosphorus" name="total_phosphorus" step="0.1">
            </div>

            <div class="form-group">
                <label for="total_nitrogen">总氮 (mg/L):</label>
                <input type="number" id="total_nitrogen" name="total_nitrogen" step="0.1">
            </div>

            <div class="form-group">
                <label for="status">状态:</label>
                <select name="status" id="status">
                    <option value="">-- 选择状态 --</option>
                    <option value="正常">正常</option>
                    <option value="维护">维护</option>
                </select>
            </div>

            <button type="submit" class="btn">提交水文数据</button>
        </form>
    </div>
</body>
</html>